import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
import QtQuick.Dialogs 1.0
import QtQuick.XmlListModel 2.0
import QtQuick.Controls.Styles 1.0

Rectangle {
    id: rectanglePaneSkillSynergy
    color: "steelblue"
    clip: true

    Item {
        anchors.fill: parent
        anchors.margins: 6

        Text {
            id: textEditTitle
            text: "Skill Synergies"
            color: "white"
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.right: parent.right
            font.pixelSize: 16
            font.bold: true
            wrapMode: Text.WordWrap
        }

        Text {
            id: textSkillName
            anchors.top: textEditTitle.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.topMargin: 8

            text: modelSkills.count > 0 ? modelSkills.get(editIndex).skillName : ""

            color: "white"
            font.bold: true;
        }

        ScrollView {
            id: scrollViewSkillSynergies
            anchors.top: textSkillName.bottom
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            anchors.topMargin: 6

            ListView {
                model: modelSkills
                spacing: 2

                delegate: ComponentCheckBox {
                    anchors.left: parent.left
                    anchors.right: parent.right
                    visible: skillName !== modelSkills.get(editIndex).skillName

                    /// \note Reduce hidden row height, so there won't be empty space in between shown items
                    /// \author Jussi
                    /// \date 2013-10-09
                    height: visible ? 12 : 0
                    text: skillName

                }

            }

        }
    }


}

